    // Google gadget user preferences
    var prefs = new gadgets.Prefs();
    var html = "";
    var div = document.getElementById('content_div');


	function version() {
	  div.innerHTML = "JS version 0.1";
	};
		
	function showPortrait(iPrefs) {    

	    var path = "";
	    var size = "";
	    if (iPrefs.getString('portraitType') == 'M') {
			path = "http://image.eveonline.com/Character/";
			size = iPrefs.getString('portraitSize');
	    } else {
			path="http://oldportraits.eveonline.com/Character/";
			size = "256";
	    }
		 
	  var html = "<div style='padding: 5px;font-family:Arial, Helvetica;" 
          + "text-align:center;font-size:90%'>"; 
	  var url = path + iPrefs.getString('charID') + '_' + size + '.jpg';
	  html += '<img src="' + url + '"/>';
	  html += '</div>';
      div.innerHTML = html;
    };
	gadgets.util.registerOnLoadHandler(showPortrait(prefs));



